home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Containers / SimpleApp / WinUtil.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-09-06  |  1002 b   |  61 lines  |  [TEXT/CWIE]

  1. #include "Protos.h"
  2.  
  3. Boolean IsAppWindow(WindowPtr window)
  4. /*
  5.     Determine if the window in question belongs to our application
  6.     or a desk accessory.
  7. */
  8. {
  9.     if (window == NULL)
  10.         return false;
  11.     else
  12.         return ((WindowPeek) window)->windowKind >= 0;
  13.  
  14. Boolean    IsDAWindow(WindowPtr window)
  15. {
  16.     if (window == NULL)
  17.         return false;
  18.     else
  19.          return ((WindowPeek) window)->windowKind < 0;
  20. }    
  21.  
  22. void DoDeactivate(WindowPtr window)
  23. {
  24.     if (IsAppWindow(window))
  25.     {
  26.         HiliteControls(window,FALSE);
  27.     }
  28.  
  29. void DoActivate(WindowPtr window)
  30. {
  31.     if (IsAppWindow(window))
  32.     {
  33.         HiliteControls(window,TRUE);
  34.         
  35.         InitCursor();
  36.     }
  37. }
  38.  
  39. void HiliteControls(WindowPtr theWindow, Boolean active)
  40. /*
  41.     Traverse the control list of theWindow, highlighting each as appropriate
  42. */
  43. {
  44.     WindowPeek        windPeek;
  45.     ControlHandle    trav;
  46.     
  47.     windPeek = (WindowPeek) theWindow;
  48.     trav = windPeek->controlList;
  49.     while (trav != NULL) 
  50.     {
  51.         if (active)
  52.             HiliteControl(trav,0);
  53.         else
  54.             HiliteControl(trav,255);
  55.         trav = (*trav)->nextControl;
  56.     }
  57.  
  58.